import http from '../utils/http.js'
import {
	useLoginStore
} from '@/store/loginStore.js'

const loginStore = useLoginStore()
//添加就诊人
export const addPatient = (data) => http({
	url: '/patient/add',
	data,
	method: 'post'
})
//获取就诊人列表
export const getPatientList = () => {
	return http({
		url: '/patient/list',
		params: {
			id: loginStore.id
		}
	})
}
//更新就诊人信息
export const updatePatient = (data) => {
	return http({
		url: '/patient/update',
		method: 'post',
		data
	})
}
//删除就诊人信息
export const delPatient = (id) => {
	return http({
		url: '/patient/delete',
		method: 'post',
		params: {
			id
		}
	})
}
//在线退款
export const returnMoney = (id, returnMoney) => {
	return http({
		url: '/onlinereturn/returnmoney',
		method: 'get',
		params: {
			id,
			returnMoney
		}
	})
}
//门诊费用
export const getPatientExpenses = (data) => {
	return http({
		url: '/outpatientfee/list',
		params: data
	})
}
//候诊查询
export const getWaitingInfo = () => {
	return http({
		url: `/app/wait/${loginStore.id}`
	})
}
